package cn.iocoder.an.module.business.dal.mysql.drawconfig;

import java.util.*;

import cn.iocoder.an.framework.common.pojo.PageResult;
import cn.iocoder.an.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.an.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.an.module.business.dal.dataobject.drawconfig.DrawConfigDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.an.module.business.controller.admin.drawconfig.vo.*;

/**
 * 图号配置 Mapper
 *
 * @author zzy
 */
@Mapper
public interface DrawConfigMapper extends BaseMapperX<DrawConfigDO> {

    default PageResult<DrawConfigDO> selectPage(DrawConfigPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DrawConfigDO>()
                .likeIfPresent(DrawConfigDO::getCustomerAccount, reqVO.getCustomerAccount())
                .likeIfPresent(DrawConfigDO::getCustomerName, reqVO.getCustomerName())
                .likeIfPresent(DrawConfigDO::getStoreLocation, reqVO.getStoreLocation())
                .likeIfPresent(DrawConfigDO::getStoreName, reqVO.getStoreName())
                .likeIfPresent(DrawConfigDO::getDrawingNumber, reqVO.getDrawingNumber())
                .likeIfPresent(DrawConfigDO::getProductName, reqVO.getProductName())
                .orderByAsc(DrawConfigDO::getCustomerAccount));
    }

}